    <!--头部 -->
    {include file="common/admin_header.html"}
    <!--头部 -->
    <!--顶部导航 -->
    {include file="common/top_nav.html"}
    <!--顶部导航 -->

    <!--左侧导航 -->
    {include file="common/left_nav.html"}
    <!--左侧导航 -->
    <style>
        .form-control{
            width: 40%;
        }
    </style>
        </section>
        <section class="content">
            <div class="">
                <div  class="">
                    <div class="box box-success">
                        <div class="box-header with-border">
                            <h3 class="box-title">{if $a=='add'}添加{else}编辑{/if}文章分类</h3>
                        </div>
                        <!-- 数据的显示 -->
                        <div class="box-body" id="data-list">

                            <form enctype="multipart/form-data" method="post" action="">
                                <div class="form-group">
                                    <label class="item-label">所属分类</label>
                                    <select class="form-control" name="catname" id="catname">

                                        <option value="0">顶级分类</option>
                                        {foreach from=$cate_name item=cat_info}
                                        <option  style="margin-left:{$cat_info.level}em" value='{$cat_info.cat_id}'{if $data.parent_id eq $cat_info.cat_id}selected{/if}>{$cat_info.html}{$cat_info.cat_name}</option>
                                        {/foreach}
                                    </select>
                                </div>
                                <div class="form-group item_title ">
                                    <label >文章分类名称</label>
                                    <div class="controls">
                                        <input type="text" name="cat_name" id="cat_name" value="{$data.cat_name}" class="form-control input text">
                                    </div>
                                </div>
                                <div class="form-group item_title ">
                                    <label class="item-lable">文章描述</label>
                                    <div class="controls">
                                        <textarea name="cat_desc" id="cat_desc" cols="68" rows="5">{$data.cat_desc}</textarea>
                                    </div>
                                </div>
                                <div class="form-group item_title ">
                                    <label class="item-label">排序<span class="check-tips">（<span class="small">数字越大靠前</span>）</span></label>
                                    <div class="controls">
                                        <input type="text" name="sort_order" id="sort_order" value="{$data.sort_order}" class="form-control input text">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">所属类型</label>
                                    <select class="form-control" name="cat_type" id="cat_type">
                                        <option value="1" {if $data.cat_type eq 1}selected{/if}>普通分类</option>
                                        <option value="2" {if $data.cat_type eq 2}selected{/if}>系统分类</option>
                                        <option value="2" {if $data.cat_type eq 3}selected{/if}>网店信息</option>
                                        <option value="2" {if $data.cat_type eq 4}selected{/if}>帮助分类</option>
                                        <option value="2" {if $data.cat_type eq 5}selected{/if}>网店帮助</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label class="item-label">是否显示到导航栏</label>
                                    <select class="form-control" name="show_in_nav" id="show_in_nav">
                                        <option value="1" {if $data.show_in_nav eq 1}selected{/if}>是</option>
                                        <option value="0" {if $data.show_in_nav eq 0}selected{/if}>否</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <input type="hidden"  value="{$data.cat_id}" name="cat_id" id="cat_id">
                                    <button target-form="builder-form" type="submit" class="btn btn-primary">确定</button>
                                    <button onclick="javascript:history.back(-1);return false;" class="btn btn-default return visible-md-inline visible-lg-inline">返回</button>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    {include file="common/admin_footer.html"}
    <script>
        //这是JS 封装的类 用于获取地址栏的参数
        function GetQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        $(function(){
            $('#img_id').val(GetQueryString('img_id'));
            $("#file-3").fileinput({
                showUpload: false,
                showCaption: false,
                browseClass: "btn btn-primary btn-lg",
                fileType: "any",
                previewFileIcon: "<i class='glyphicon glyphicon-king'></i>"
            });
            $(document).ready(function() {
                $("#test-upload").fileinput({
                    'showPreview' : false,
                    'allowedFileExtensions' : ['jpg', 'png','gif'],
                    'elErrorContainer': '#errorBlock'
                });
            });

        });
    </script>
